<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws.
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/classes/Benchmark.class.php, $Author:  $ */

/**
 *
 * @author Raymond Benc aka natio
 * @package Benchmark
 */
class BenchMark
{
	function start()
	{
		$t = microtime();
		$time = explode (" ", $t);
		$this->start_time = doubleval($time[0])+$time[1];
	}

	function finish2()
	{
		$t = microtime();
		$time = explode (" ", $t);
		$end_time = doubleval($time[0])+$time[1];
		return substr(sprintf ("%01.4f", $end_time-$this->start_time), 0, 6);
	}

	function finish()
	{
		$t = microtime();
		$time = explode (" ", $t);
		$end_time = doubleval($time[0])+$time[1];
		print '
		<table width="98%" border="1" cellspacing="0" cellpadding="2" style="margin-left:auto;margin-right:auto;color:black;font-family: Tahoma,Sans-Serif">
		<tr>
			<td colspan="3" style="background:#195B85;padding:6px;color:#fff;text-align:center;font-size:12pt;">
			(<b>Page Loaded in: '.substr(sprintf ("%01.4f", $end_time-$this->start_time), 0, 6).'</b>)
			</td>
		</tr>
		</table>
		</body>
		</html>
		';
	}
}

?>